<?php

namespace App\Console\Commands;

use App\Services\RepaymentPlanJobsService;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Log;

class RepaymentAutoWithdrawEveryMinuteJobs extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'timer:repayment-auto-withdraw-every-minute-jobs';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'repayment plan auto withdraw timer';

    protected $repaymentPlanJobsService;

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct(RepaymentPlanJobsService $repaymentPlanJobsService)
    {
        parent::__construct();
        $this->repaymentPlanJobsService = $repaymentPlanJobsService;
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        //还款失败自动提现
        $this->repaymentPlanJobsService->repaymentPlanAutoWithdrawJobs();
    }
}
